package com.starleague.battletech.hexagonal;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.starleague.hexagonal.AbstractHexCoordinate;
import com.starleague.hexagonal.flat.AbstractFlatHex;

public abstract class AbstractBattletechHex
        extends AbstractFlatHex
        implements IBattletechHex
{
    private int elevation;
    private List<? extends AbstractBattletechHexTerrain> hexTerrainList;

    protected AbstractBattletechHex(AbstractBattletechHexGrid hexGrid,
                                    AbstractHexCoordinate hexCoordinate,
                                    int elevation)
    {
        super(hexGrid, hexCoordinate);
        this.elevation = elevation;
        this.hexTerrainList = new ArrayList<AbstractBattletechHexTerrain>();
    }

    protected AbstractBattletechHex()
    {
        //
    }

    @Override
    public AbstractBattletechHexGrid getHexGrid()
    {
        return (AbstractBattletechHexGrid) super.getHexGrid();
    }

    @Override
    public int getElevation()
    {
        return this.elevation;
    }

    protected void setElevation(int elevation)
    {
        this.elevation = elevation;
    }

    @Override
    public List<? extends AbstractBattletechHexTerrain> getHexTerrainList()
    {
        return this.hexTerrainList;
    }

    // void addHexTerrain(AbstractBattletechHexTerrain hexTerrain)
    // {
    // this.hexTerrainList.add(hexTerrain);
    // }
    //
    // @Override
    // public void removeHexTerrain(BattletechHexTerrain hexTerrain)
    // {
    // this.hexTerrainList.remove(hexTerrain);
    // }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("elevation", this.elevation);
        infoPropertyMap.put("terrain", this.hexTerrainList);
        return infoPropertyMap;
    }
}
